﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ProyectoHCI
{
    public partial class AgregarPreguntas : Plantilla
    {
        protected Login login;
        protected Form padre;
        public AgregarPreguntas(Form p, Login l)
        {
            InitializeComponent();
            base.InitializeComponent();
            padre = p;
            login = l;
        }

        private void AgregarPreguntas_Load(object sender, EventArgs e)
        {

        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {
            //this.Visible = false;
            this.Dispose();
            padre.Visible = true;
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            String pregunta;
            String opcion1, opcion2, opcion3, opcion4,categoria;
            int check=0;
            pregunta = textBox1.Text;
            opcion1 = textBox2.Text;
            opcion2 = textBox3.Text;
            opcion3 = textBox4.Text;
            opcion4 = textBox5.Text;
            categoria = comboBox1.Text;
            if (radioButton1.Checked == true)
                check = 1;
            if (radioButton2.Checked == true)
                check = 2;
            if (radioButton3.Checked == true)
                check = 3;
            if (radioButton4.Checked == true)
                check = 4;

            (new VistaPrevia(this, pregunta, opcion1, opcion2, opcion3, opcion4,check,categoria)).Visible=true;
            this.Enabled = false;
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }
        private void seleccionoPrincipal(object sender, EventArgs e)
        {
            textBox1.SelectionStart = 0;
            textBox1.SelectionLength = textBox1.Text.Length;
        }
        private void selecciono1(object sender, EventArgs e)
        {
            textBox2.SelectionStart = 0;
            textBox2.SelectionLength = textBox2.Text.Length;
        }
        private void selecciono2(object sender, EventArgs e)
        {
            textBox3.SelectionStart = 0;
            textBox3.SelectionLength = textBox3.Text.Length;
        }
        private void selecciono3(object sender, EventArgs e)
        {
            textBox4.SelectionStart = 0;
            textBox4.SelectionLength = textBox4.Text.Length;
        }
        private void selecciono4(object sender, EventArgs e)
        {
            textBox5.SelectionStart = 0;
            textBox5.SelectionLength = textBox5.Text.Length;
        }

        private void textBox5_TextChanged(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            (new ExitoAgregarPregunta(this)).Visible = true;
            this.Enabled = false;
        }
        public void cerrar()
        {
            //this.Visible = false;
            this.Dispose();
            padre.Visible = true;
        }
        private void cerrarSesion(object sender, LinkLabelLinkClickedEventArgs e)
        {//BOTON CERRAR SESION
            login.Visible = true;
            this.Hide();

        }
    }
}
